﻿using System;

namespace MovieModel.Common
{
    public class ProgressWatcher
    {
        private int _total, _done;
        private string _currentText;

        public event EventHandler<EventArgs> TextUpdated;
        public event EventHandler<EventArgs> ProgressUpdated;

        public int Total
        {
            get { return _total; }
            set 
            { 
                _total = value;
                if (ProgressUpdated != null) ProgressUpdated(this, EventArgs.Empty);
            }
        }

        public int Completed
        {
            get { return _done; }
            set
            {
                _done = value;
                if (ProgressUpdated != null) ProgressUpdated(this, EventArgs.Empty);
            }
        }

        public string Text
        {
            get { return _currentText; }
            set 
            {
                _currentText = value;
                if (ProgressUpdated != null) TextUpdated(this, EventArgs.Empty);

            }
        }
    }
}
